<template>
  <div class="app">
      <h4>这是App组件(祖)</h4>
      <input type="number" v-model="price">
      <h4> {{name}}---{{price}}</h4>
      <child/>
  </div>
</template>

<script>
  import {reactive,toRefs,provide} from 'vue'
  import child from './components/child.vue'
  export default {
    name:'App',
    components:{child},
    setup(){
      let car = reactive({name:'奔驰',price:40})
      provide('car',car)
      return {...toRefs(car)}
    }
  }
</script>

<style scoped>
  .app{
    background-color: gray;
    padding: 15px;
  }
</style>
